<?php
include('../includes/definer.php');
include(INC.'php/bootstrap.php');
$imagen = Doctrine::getTable('imagen')->find($_POST['id']);
if ($imagen->id_publicacion || $imagen->id_slider) {
    @unlink(INC.'../content/images/thumb/'.$imagen->src);
    if ($imagen->is_video == 0) @unlink(INC.'../content/images/'.$imagen->src);
} else {
    @unlink(INC.'../content/tmp/images/thumb/'.$imagen->src);
    if ($imagen->is_video == 0) @unlink(INC.'../content/tmp/images/'.$imagen->src);
}
$imagen->delete();
?>
